function preventDouble(callback) {
  let lock = false
  return async function () {
    if (lock) {
      return
    }
    lock = true

    // 这里进行异步函数
    try {
      if (callback && typeof callback == 'function') {
        await callback.apply(this, arguments)
      }
    } catch (error) {
    } finally {
      click = false
    }
  }
}

const b = preventDouble(fn)

b(1)
async function fn(arg) {
  return new Promise(async (resolve, reject) => {
    // 假设fn2依赖于fn1的执行
    const res1 = await fn1()
    const res2 = await fn2(res1)
    // 没有依赖的,可能会按照实际需求在不同的地方进行 resolve 或 reject
    Promise.all([fn3(), fn4()])
      .then((res) => {
        resolve()
      })
      .catch(() => {
        reject()
      })
      .finally(() => {})
  })
}
async function fn1() {}
async function fn2() {}
async function fn3() {}
async function fn4() {}
